<template>
  <div>
    <template>
      <el-table :data="tableData" border style="width: 100%" align="center">
        <el-table-column type="index" label="#" width="70"></el-table-column>
        <el-table-column prop="authName" label="权限名称" width="350"></el-table-column>
        <el-table-column prop="path" label="权限路径" width="350"></el-table-column>
        <el-table-column label="等级" width="350">
          <template v-slot="scope">
            <el-tag type="success" v-if="scope.row.level == 1">二级</el-tag>
            <el-tag type="warning" v-else-if="scope.row.level== 2">三级</el-tag>
            <el-tag v-else>一级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>*
 

<script>
export default {
  name: "",
  data() {
    return {
      tableData: []
    };
  },
created() {
      this.rightsList()
  },
  methods: {
   

    async rightsList (){
        const res =await this.$http.get('/rights/list')
        console.log(res);
        
        const {data,meta} = res.data;
        console.log(res.data);
        
        if(meta.status !==200){
            this.$message.error(meta.msg)
        }else{
            this.tableData = data
        }
    }
  },
  computed: {},
  watch: {}
};
</script>

<style lang="scss">
</style>

